package com.wyhello.tube4.spring.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.wyhello.tube4.pojo.Bag;
import com.wyhello.tube4.pojo.Reality;
import com.wyhello.tube4.pojo.Reside;
import com.wyhello.tube4.spring.model.AnalysisDrawModel;
import com.wyhello.tube4.spring.model.BagRecordsModel;
import com.wyhello.tube4.spring.model.MeterRecordsModel;
import com.wyhello.tube4.spring.model.ResideRecordsModel;
/**
 * 锅炉分析
 * @author Administrator
 *
 */
@Controller
public class AnalysisBoilerDrawController {
	@Autowired
	private AnalysisDrawModel analysisDrawModel;
	@Autowired
	private MeterRecordsModel meterRecordsModel;
	@Autowired
	private ResideRecordsModel resideRecordsModel;
	@Autowired
	private BagRecordsModel bagRecordsModel;
	/**
	 * 查询锅炉信息
	 * @return
	 */
	@RequestMapping("/boilerDraw/queryRealitys")
	public ModelAndView queryRealitys(){
		List<Reside> boilers =  meterRecordsModel.queryResideByBoiler();
		ModelAndView model = new ModelAndView("main");
		model.addObject("boilers",boilers);
		return model;
	}
	
	/**
	 * 外径横向每次测量的最大值、最小值、平均值
	 * @param boilerId 锅炉ID
	 * @return
	 */
	@RequestMapping("/boilerDraw/boilerDiameterX")
	public ModelAndView diameterX(int boilerId,String begin,String end){
		
		ModelAndView model =  analysisDrawModel.getAnyliseBoiler("outerDiameterX", begin, end, boilerId);
		return model;
	}
	/**
	 * 外径纵向每次测量的最大值、最小值、平均值
	 * @param boilerId 锅炉ID
	 * @return
	 */
	@RequestMapping("/boilerDraw/boilerDiameterY")
	public ModelAndView diameterY(int boilerId,String begin,String end){
		
		ModelAndView model =  analysisDrawModel.getAnyliseBoiler("outerDiameterY", begin, end, boilerId);
		return model;
	}
	/**
	 * 蠕脹横向每次测量的最大值、最小值、平均值
	 * @param boilerId 锅炉ID
	 * @return
	 */
	@RequestMapping("/boilerDraw/boilerCreepX")
	public ModelAndView creepX(int boilerId,String begin,String end){
		
		ModelAndView model =  analysisDrawModel.getAnyliseBoiler("creepValueX", begin, end, boilerId);
		return model;
	}
	/**
	 * 蠕脹纵向每次测量的最大值、最小值、平均值
	 * @param boilerId 锅炉ID
	 * @return
	 */
	@RequestMapping("/boilerDraw/boilerCreepY")
	public ModelAndView creepY(int boilerId,String begin,String end){
		
		ModelAndView model =  analysisDrawModel.getAnyliseBoiler("creepValueY", begin, end, boilerId);
		return model;
	}
	/**
	 * 壁厚每次测量的最大值、最小值、平均值
	 * @param boilerId 锅炉ID
	 * @return
	 */
	@RequestMapping("/boilerDraw/boilerWallThick")
	public ModelAndView wallThick(int boilerId,String begin,String end){
		
		ModelAndView model =  analysisDrawModel.getAnyliseBoiler("wallThick", begin, end, boilerId);
		return model;
	}
	/**
	 * 蠕脹纵向每次测量的最大值、最小值、平均值
	 * @param boilerId 锅炉ID
	 * @return
	 */
	@RequestMapping("/boilerDraw/boilerWearRate")
	public ModelAndView wearRate(int boilerId,String begin,String end){
		
		ModelAndView model =  analysisDrawModel.getAnyliseBoiler("wearRate", begin, end, boilerId);
		return model;
	}
	/**
	 * 估算寿命每次测量的最大值、最小值、平均值
	 * @param boilerId 锅炉ID
	 * @return
	 */
	@RequestMapping("/boilerDraw/boilerLifetime")
	public ModelAndView lifetime(int boilerId,String begin,String end){
		
		ModelAndView model =  analysisDrawModel.getAnyliseBoiler("lifetime", begin, end, boilerId);
		return model;
	}
}
